<template>
  <div>
    <el-card class="box-card"
             style="margin-top:20px">
      <el-descriptions class="margin-top"
                       :column="2"
                       border>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-user"></i>
            月子中心名称
          </template>
          {{yuzidetailsInfo.postpartum_name}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-mobile-phone"></i>
            所属地区
          </template>
          {{yuzidetailsInfo.provinces}}/{{yuzidetailsInfo.city}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-location-outline"></i>
            详细地址
          </template>
          {{yuzidetailsInfo.address}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-tickets"></i>
            公司名称
          </template>
          {{yuzidetailsInfo.company_name}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-office-building"></i>
            营业执照
          </template>
          {{yuzidetailsInfo.license_file_id}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-office-building"></i>
            开户行名称
          </template>
          {{yuzidetailsInfo.bank_name}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-office-building"></i>
            对公银行账号
          </template>
          {{yuzidetailsInfo.bank_account}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-office-building"></i>
            店铺照片
          </template>
          {{yuzidetailsInfo.store_file_id	}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-office-building"></i>
            合作金额
          </template>
          {{yuzidetailsInfo.cooperation_amount}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-office-building"></i>
            付款周期
          </template>
          {{yuzidetailsInfo.payment_cycle_begin}}至{{yuzidetailsInfo.payment_cycle_end}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-office-building"></i>
            合作状态
          </template>
          {{yuzidetailsInfo.cooperation_status}}
        </el-descriptions-item>
      </el-descriptions>
    </el-card>
  </div>

</template>

<script>
import { getDetails } from '@/api/system/yueziCenter'
export default {
  props: ["postpartum_id"],

  watch: {
    postpartum_id (oldValue, newValue) {
      console.log(oldValue);
      console.log(newValue);
      // oldValue旧数据newValue新数据
      //监听值 如果不一样就触发事件
      if (oldValue != newValue) {
        this.listQuery.postpartum_id = oldValue
        this.getyueziDetails(); // 你的查询方法
      }
    },
  },
  created () {
    this.getyueziDetails()
  },
  data () {
    return {
      //月子中心信息
      yuzidetailsInfo: {},
      listQuery: {
        postpartum_id: this.postpartum_id
      }
    }
  },
  methods: {
    //获取月子详情
    getyueziDetails () {
      getDetails(this.listQuery).then((res) => {
        this.yuzidetailsInfo = res.data.data[0]
        console.log(this.yuzidetailsInfo);

      })
    },


  }

}
</script>

<style>
</style>